<%@ Import Namespace="MvcContrib.FluentHtml"%>
<%@ Control Language="C#" AutoEventWireup="true"
	Inherits="System.Web.Mvc.ViewUserControl<ETestIT.Web.Controllers.PositionsController.PositionFormViewModel>" %>
<%@ Import Namespace="ETestIT.Core" %>
<%@ Import Namespace="ETestIT.Web.Controllers" %>
 

<% if (ViewContext.TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()] != null)
   { %>
    <p id="pageMessage"><%= ViewContext.TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()]%></p>
<% } %>

<%= Html.ValidationSummary()%>

<% using (Html.BeginForm())
   { %>
    <%= Html.AntiForgeryToken()%>
    <%= Html.Hidden("Position.Id", (ViewData.Model.Position != null) ? ViewData.Model.Position.Id : 0)%>

    
		
			<label for="Position_TheJobTitle">TheJobTitle:</label>
			
			    <%= this.Select("Position.TheJobTitle").Attr("size", 1).Options(ViewData.Model.Titles, c => c.Id, c => c.Name)
                .Selected((ViewData.Model.Position != null) ? ViewData.Model.Position.TheJobTitle.Id : 0)%>
			
		
		
			<label for="Position_TheComapny">TheComapny:</label>
			
				<%= this.Select("Position.TheComapny").Attr("size", 1).Options(ViewData.Model.Clients, c => c.Id, c => c.Name)
                .Selected((ViewData.Model.Position != null) ? ViewData.Model.Position.TheComapny.Id : 0)%>
			
		
		
			<label for="Position_Duration">Duration:</label>
			
				<%= this.Select("Position.Duration").Attr("size", 1).Options(ViewData.Model.Durations)
                    .Selected((ViewData.Model.Position != null) ? ViewData.Model.Position.Duration : 0)%>
			
		
		
			<label for="Position_KeySkills">KeySkills:</label>
			
                <%= this.TextArea("Position.KeySkills")
                    .Rows(5).Columns(80)
                    .Value((ViewData.Model.Position != null) ? ViewData.Model.Position.KeySkills.ToString() : "")%>
			
		
		
			<label for="Position_Location">Location:</label>
			
				<%= Html.TextBox("Position.Location",
                    (ViewData.Model.Position != null) ? ViewData.Model.Position.Location.ToString() : "")%>
			
		
		
			<label for="Position_Description">Description:</label>
			
				<%= this.TextArea("Position.Description")
                    .Rows(30).Columns(80)
                    .Value((ViewData.Model.Position != null) ? ViewData.Model.Position.Description.ToString() : "")%>
			
		
		
			<label for="Position_ThePosition">ThePosition:</label>
			
				<%= this.Select("Position.ThePosition").Attr("size", 1).Options<PositionType>()%>
			
		
        
			<label for="Position_IsStar">Is Star:</label>
			
				<%= this.CheckBox("Position.IsStar").Checked((ViewData.Model.Position != null) ? ViewData.Model.Position.IsStar : false)%>
			
		
		
			<label for="Position_ExcelentCommunicationSkills">Excelent Communication Skills:</label>
			
				<%= this.CheckBox("Position.ExcelentCommunicationSkills").Checked((ViewData.Model.Position != null) ? ViewData.Model.Position.ExcelentCommunicationSkills : false)%>
			
		
		
			<label for="Position_Openings">Openings:</label>
			
				<%= Html.TextBox("Position.Openings",
                  (ViewData.Model.Position != null) ? ViewData.Model.Position.Openings.ToString() : "")%>
			
		
		
			<label for="Position_IsRemote">Is Remote:</label>
			
				<%= this.CheckBox("Position.IsRemote").Checked((ViewData.Model.Position != null) ? ViewData.Model.Position.IsRemote : false)%>
			
			    
		
            <%= Html.SubmitButton("btnSave", "Save")%>
	        <%= Html.Button("btnCancel", "Cancel", HtmlButtonType.Button,
                    "window.location.href = '" + Html.BuildUrlFromExpression<PositionsController>(c => c.Index()) + "';")%>
        
<% } %>
